import { ref, computed, inject } from 'vue'
import { ConfigProviderProps } from '../../configProvider/src/interface'

export const useConfigTheme = () => {
  const config = inject<ConfigProviderProps>('configProviderOptions')
  if (!config) {
    return
  }

  const theme = computed(() => config.theme)

  return {
    theme: theme.value,
    config
  }
}
